
package manutençãoempregados.GUI;

import manutençãoempregados.UTILS.CadastrarEmpregado;

public class MenuEmpregado extends javax.swing.JFrame {

    public MenuEmpregado() {
        initComponents();
        cadEmpr.recuperarCadastros();
    }

    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        CalculoDesignadoButton = new javax.swing.JButton();
        CadastroEmpregadoButton = new javax.swing.JButton();
        Titulo = new javax.swing.JLabel();
        AlterarDadosButton = new javax.swing.JButton();
        ExclusaoEmpredadoButton = new javax.swing.JToggleButton();

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
        setCursor(new java.awt.Cursor(java.awt.Cursor.DEFAULT_CURSOR));
        setFocusableWindowState(false);
        setFont(new java.awt.Font("Aharoni", 0, 24)); // NOI18N

        CalculoDesignadoButton.setForeground(new java.awt.Color(0, 51, 51));
        CalculoDesignadoButton.setText("Calculo emprestimo consignado");
        CalculoDesignadoButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                CalculoDesignadoButtonActionPerformed(evt);
            }
        });

        CadastroEmpregadoButton.setForeground(new java.awt.Color(0, 51, 51));
        CadastroEmpregadoButton.setText("Cadastro de um Empregado");
        CadastroEmpregadoButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                CadastroEmpregadoButtonActionPerformed(evt);
            }
        });

        Titulo.setFont(new java.awt.Font("Tahoma", 0, 36));
        Titulo.setForeground(new java.awt.Color(0, 153, 204));
        Titulo.setText("Manutencao de Empregados");

        AlterarDadosButton.setForeground(new java.awt.Color(0, 51, 51));
        AlterarDadosButton.setText("Alterar dados de um Empregado");
        AlterarDadosButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                AlterarDadosButtonActionPerformed(evt);
            }
        });

        ExclusaoEmpredadoButton.setForeground(new java.awt.Color(0, 51, 51));
        ExclusaoEmpredadoButton.setText("Exclusao de um Empregado");
        ExclusaoEmpredadoButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                ExclusaoEmpredadoButtonActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap(110, Short.MAX_VALUE)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                        .addComponent(CalculoDesignadoButton, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                        .addGroup(javax.swing.GroupLayout.Alignment.LEADING, layout.createSequentialGroup()
                            .addComponent(CadastroEmpregadoButton)
                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                            .addComponent(AlterarDadosButton)
                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                            .addComponent(ExclusaoEmpredadoButton)))
                    .addGroup(layout.createSequentialGroup()
                        .addGap(32, 32, 32)
                        .addComponent(Titulo)))
                .addGap(57, 57, 57))
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addGap(49, 49, 49)
                .addComponent(Titulo)
                .addGap(33, 33, 33)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(AlterarDadosButton, javax.swing.GroupLayout.DEFAULT_SIZE, 46, Short.MAX_VALUE)
                    .addComponent(ExclusaoEmpredadoButton, javax.swing.GroupLayout.DEFAULT_SIZE, 46, Short.MAX_VALUE)
                    .addComponent(CadastroEmpregadoButton, javax.swing.GroupLayout.DEFAULT_SIZE, 46, Short.MAX_VALUE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(CalculoDesignadoButton, javax.swing.GroupLayout.PREFERRED_SIZE, 44, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(56, 56, 56))
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void CadastroEmpregadoButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_CadastroEmpregadoButtonActionPerformed
        CadastroEmpregadoGUI openCadastro = new CadastroEmpregadoGUI(this,true);
        openCadastro.setVisible(true);
    }//GEN-LAST:event_CadastroEmpregadoButtonActionPerformed

private void AlterarDadosButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_AlterarDadosButtonActionPerformed
        AlteraEmpregadoGUI openAltera = new AlteraEmpregadoGUI(this, true);
        openAltera.setVisible(true);
}//GEN-LAST:event_AlterarDadosButtonActionPerformed

private void ExclusaoEmpredadoButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_ExclusaoEmpredadoButtonActionPerformed
        ExcluiEmpregadoGUI openExlui = new ExcluiEmpregadoGUI(this, true);
        openExlui.setVisible(true);
}//GEN-LAST:event_ExclusaoEmpredadoButtonActionPerformed

private void CalculoDesignadoButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_CalculoDesignadoButtonActionPerformed
        CalculoEmprestimoDesignadoGUI openCalculo = new CalculoEmprestimoDesignadoGUI(this, true);    
        openCalculo.setVisible(true);
}//GEN-LAST:event_CalculoDesignadoButtonActionPerformed

    public static void main(String args[]) {
        java.awt.EventQueue.invokeLater(new Runnable() {
            @Override
            public void run() {
                new MenuEmpregado().setVisible(true);
            }
        });
    }   

    private CadastrarEmpregado cadEmpr = new CadastrarEmpregado();

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton AlterarDadosButton;
    private javax.swing.JButton CadastroEmpregadoButton;
    private javax.swing.JButton CalculoDesignadoButton;
    private javax.swing.JToggleButton ExclusaoEmpredadoButton;
    private javax.swing.JLabel Titulo;
    // End of variables declaration//GEN-END:variables

}
